/*
 	This file is part of ExportGnuCash.

    ExportGnuCash is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ExportGnuCash is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ExportGnuCash.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.sourceforge.gnucash;
 

import java.util.Comparator;

import net.sourceforge.gnucash.model.Account;

/**
 * Compares two Account object instances using their full names
 */
public class AccountComparator implements Comparator
{
	/**
	 * Compares the full account names of the two inputs
	 * @param o1 Input 1
	 * @param o2 Input 2
	 * @return -1 if o1 &lt; o2, 0 if o1 == o2, or 1 if o1 &gt; o2
	 */
	public int compare(Object o1, Object o2) {
        return ((Account) o1).getFullName().compareTo(((Account) o2).getFullName());
	}
}
